home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 3⁄9⁄90 / 0811-Re Model⁄View-Mar90 < prev    next >
Encoding:
Text File  |  1990-03-09  |  1.3 KB  |  33 lines  |  [TEXT/GEOL]

  1. Item    2643816                         5-March-90        09:37PST
  2.  
  3. From:   WILSON6                         Wilson, Dave-Personal Concepts,VCA
  4.  
  5. To:     POWERUP.DEV                     Power Up Software,PRT
  6.  
  7. cc:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Re: Model/View
  10.  
  11. James,
  12.  
  13. In Smalltalk-80, the Object in class in Smalltalk keeps dependents in a class
  14. variable. Furthermore, it has a Model class that is a subclass of Object with a
  15. "dependents" instance variable that can be used to keep track of a collection
  16. of views on that model.  Each View has a "model" instance variable to point to
  17. its model.
  18.  
  19. Typically, when you change the data in a model object, it sends itself the
  20. message "changed".  The changed method sends the update message to each
  21. dependent object (with parameters telling what aspect of the model changed if
  22. you wish).
  23.  
  24. As an example, if the name of your TCustomer object changed and it were a
  25. subclass of Model, it could send itself the changed message, passing name as a
  26. parameter.  This would cause your TCustomerInvoiceView and TCustomerSummaryView
  27. objects to get the Update message with name as a parameter.  Your Update
  28. methods could then invalidate the relevant part of their views.  I have
  29. oversimplified this a bit, but that is the basic idea.
  30.  
  31. Dave
  32.  
  33.